home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 11 / 011.d81 / graph sim 64 (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1985-01-01  |  996 b   |  55 lines

  1. 1 rem graphic analysis simulation c64
  2. 2 :
  3. 3 rem by ian adam
  4. 6 :
  5. 7 rem caution: run this program at your own risk!!
  6. 8 :
  7. 10 rem set sound chip:
  8. 20 x=54273:y=x+3
  9. 30 pokey+1,25:pokey+2,31
  10. 40 pokey+20,15
  11. 50 :
  12. 60 rem get screen ready:
  13. 70 print"[147][154]"
  14. 80 poke53280,3:poke53281,1
  15. 90 x1=56260:x2=1988
  16. 100 :
  17. 110 rem setup
  18. 120 i=rnd(-ti)
  19. 130 deffna(n)=int(rnd(i)*n)
  20. 140 fori=1to26
  21. 145 ifpeek(197)<>64then60000:rem            added by loadstar
  22. 150 iffna(70)<1thena=-32
  23. 160 :
  24. 170 rem le is length of bar in graph
  25. 180 le=fna(18)+fna(18)+1
  26. 190 ifa<0thena=a+1:le=fna(7)+1
  27. 200 printchr$(i+64)le;
  28. 210 pokex,le+1
  29. 220 pokey,33
  30. 230 :
  31. 240 rem c is colour of bar
  32. 250 c=fna(15):ifc=1then250
  33. 260 :
  34. 270 rem ch is reverse character to be plotted
  35. 280 ch=fna(129)+127
  36. 290 :
  37. 300 rem plot bar
  38. 310 gosub1000
  39. 320 pokey,32
  40. 330 next
  41. 340 goto140
  42. 940 :
  43. 950 bar chart subroutine:
  44. 960 : le = length of bar
  45. 970 : c  = colour of bar
  46. 980 : ch = character to plot
  47. 990 :
  48. 1000 forb=1tole
  49. 1010 pokex1+b,c
  50. 1020 pokex2+b,ch
  51. 1030 next
  52. 1040 print:return
  53. 60000 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  54. 60010 poke631,13:poke632,13:poke198,2:end
  55.